#include "Comm.hpp"

int main()
{
    int wfd = open(Path, O_WRONLY);
    if (wfd < 0)
    {
        cerr << "open fail,erro:" << errno << ",errstring" << strerror(errno) << endl;
        return 1;
    }

    string buffer;
    while (true)
    {
        cout << "Please enter massage:";
        getline(cin, buffer);
        if ("quit" == buffer)
            break;
        ssize_t n = write(wfd, buffer.c_str(), buffer.size());
        if (n < 0)
        {
            cerr << "write fail,erro:" << errno << ",errstring" << strerror(errno) << endl;
            break;
        }
    }
    close(wfd);
    return 0;
}